<?php

require_once 'SignalSlot.php';

class SignalHelper {
	protected static $instance=null;
	public static function invoke($caller) {
		if(null === self::$instance) {
			self::$instance = new self();
		}
		return self::$instance;
	}
	
	public function emit($sSignal, &$aParams=array()) {
		$signalSlot = SignalSlot::getInstance();
		return $signalSlot->emit($sSignal, &$aParams);
	}
	
	public function subscribe($sSignal, $slot, $iPriority=0) {
		$signalSlot = SignalSlot::getInstance();
		$signalSlot->addSignal($sSignal);
		$signalSlot->addSlot($sSignal, $slot, $iPriority);
	}
	
}
